package gazzera.node.core.messages;

import gazzera.utils.*;

import java.io.*;


public class StartToSend extends Message
{
	public FileID fileId;
	public int chunk;
	public int offset;

	public StartToSend()
	{
		super();
	}

	public StartToSend(FileID fileId, int chunk, int offset)
	{
		super();
		this.fileId = fileId;
		this.chunk = chunk;
		this.offset = offset;
	}

	@Override
	protected void recv(DataInputStream s) throws IOException
	{
		fileId = readFileID(s);
		chunk = readInt(s);
		offset = readInt(s);
	}

	@Override
	protected void send(DataOutputStream s) throws IOException
	{
		sendFileID(s, fileId);	
		sendInt(s, chunk);
		sendInt(s, offset);
	}



}
